Reasoning with Continuations II : Full Abstraction for Models
نویسنده
چکیده
A fully abstract model of a programming language assigns the same meaning to two terms if and only if they have the same operational behavior. Such models are well-known for functional languages but little is known about extended functional languages with sophisticated control structures. We show that a direct model with error values and the conventional continuation model are adequate for functional languages augmented with rst-and higher-order control facilities, respectively. Furthermore , both models become fully abstract on adding a control delimiter and a parallel conditional to the programming languages. 1 The Control Structure of Lisp Many programming languages, in particular Lisp 17, 24] and Scheme 22, 26], contain sophisticated control structures with constructs for labeling the control state at an arbitrary point for later reuse. Since Lisp is an expression-oriented language , a jump to a labeled control state|just like a procedure|may also pass a parameter so that it is possible to communicate results between control points. In most Lisp systems, control points have a special status, distinct from all other values. The 0 Scheme dialect treats its control points|referred to as continuations|as ordinary, rst-class procedural objects and even uses the same syntax for continuation invocations and procedure calls. For many programming tasks, control facilities are an important means of abstraction. They avoid the cumbersome encoding of control mechanisms through boolean predicates and tests, and expli-cate the purpose of otherwise unreadable programming patterns. Moreover, by incorporating explicit statements about the control behavior, a program provides clues to the compiler for possible optimizations. However, control constructs also invalidate some common laws of reasoning that hold for functional programming languages like pure Lisp 6, 18, 27]. More technically, the operational equivalence relation for the functional subset of Lisp is not a subset of the operational equivalence relation for Lisp with control facilities. Given the importance of operational equivalence laws for reasoning about programs, this raises two crucial questions: 1. How can we reason with control facilities? 2. How can we relate the reasoning system for functional languages to the system for extended languages with control facilities? Talcott's 27, 28] and our own 6, 7, 11] results on functional languages with rst-class control abstractions provide a partial answer to the rst question. 1 There is a small number of fundamental laws for the operational equivalence relation of such languages that play a crucial role in equivalence 1 The recent work by Aiken …
منابع مشابه
Sequentiality and the CPS Semantics of Fresh Names
We investigate the domain-theoretic denotational semantics of a CPS calculus with fresh name declaration. This is the target of a fully abstract CPS translation from the nu-calculus with first-class continuations. We describe a notion of “FM-categorical” model for our calculus, with a simple interpretation of name generation due to Shinwell and Pitts. We show that full abstraction fails (at ord...
متن کاملModels of clinical reasoning with a focus on general practice: a critical review
Introduction: Diagnosis lies at the heart of general practice.Every day general practitioners (GPs) visit patients with awide variety of complaints and concerns, with often minor butsometimes serious symptoms. General practice has many featureswhich differentiate it from specialty care setting, but during thelast four decades little attention was paid to clinical reasoningin general practice. T...
متن کاملCombining and Relating Control Effects and their Semantics
Combining local exceptions and first class continuations leads to programs with complex control flow, as well as the possibility of expressing powerful constructs such as resumable exceptions. We describe and compare games models for a programming language which includes these features, as well as higher-order references. They are obtained by contrasting methodologies: by annotating sequences o...
متن کاملExtensional Semantics of Program Behaviour: Case for Support
G ame semantics is a way of characterizing programming languages and logical calculi intensionally by interpreting proofs or programs as strategies for interacting with the environment; this process of interaction can be thought of as playing a two-person game. Games can capture precisely the behaviour of higher-order programs in sequential languages, in a fashion which is very difficult or imp...
متن کاملA novel model of clinical reasoning: Cognitive zipper model
Introduction: Clinical reasoning is a vital aspect of physiciancompetence. It has been the subject of academic research fordecades, and various models of clinical reasoning have beenproposed. The aim of the present study was to develop a theoreticalmodel of clinical reasoning.Methods: To conduct our study, we applied the process of theorysynthesis in accordan...
متن کامل